package com.springmvc.web.majiang.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 
 * @ClassName: LoginController 
 * @author wangruchao
 * @date 2017年12月11日 上午11:52:40
 */
@Controller("MajiangLoginController")
@RequestMapping("/majiang")
public class LoginController {

	@RequestMapping
	public String index(Model model, HttpServletRequest request, HttpServletResponse response) throws Exception {
		return "majiang/login";
	}

	@RequestMapping("/login")
	public String index(@RequestParam("username") String username, @RequestParam("password") String password,
			Model model, HttpServletRequest request, HttpServletResponse response) {

		model.addAttribute("username", username);
		return "majiang/index";
	}

}
